<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "blog".
 *
 * @property integer $id
 * @property string $username
 * @property string $title
 * @property string $content
 * @property string $add_time
 * @property string $update_time
 */
class Blog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'blog';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'title', 'content'], 'required'],
            [['content'], 'string'],
            [['add_time', 'update_time'], 'safe'],
            [['username'], 'string', 'max' => 30],
            [['title'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'title' => 'Title',
            'content' => 'Content',
            'add_time' => 'Add Time',
            'update_time' => 'Update Time',
        ];
    }
}
